package com.ryujung.array.leetCode_29;

/*
 * @lc app=leetcode.cn id=29 lang=java
 *
 * [29] 两数相除
 */

// @lc code=start
class Solution {

    // TODO 没有思路，待后续补全
    public static int divide(int dividend, int divisor) {
        int result;
        // 处理被除数为最小值的情况
        if (dividend == Integer.MIN_VALUE && divisor == -1) {
            return Integer.MAX_VALUE;
        }
        boolean isRev = false;
        if (dividend > 0) {
            dividend = -dividend;
            isRev = !isRev;
        }
        if (divisor > 0) {
            divisor = -divisor;
            isRev = !isRev;
        }
        // 除法需要被替换
        int left = 1, right = Integer.MIN_VALUE, mid = (left + right) >> 1;
        while (left <= right) {
            if (mid * divisor > mid) {
                
            }
        }
        return 0;
    }

    public static void main(String[] args) {
        System.out.println(divide(4, 2));
        System.out.println(divide(5, 2));
        System.out.println(divide(5, 0));
    }

}
// @lc code=end
